/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package prototipopantallas;

import java.awt.Color;
import javax.swing.JFrame;

/**
 *
 * @author Jose
 */
public class Loading extends javax.swing.JFrame {
    HiloProgreso hilo;
    /**
     * Creates new form Loading
     */
    public Loading() {
        initComponents();
        iniciarSplash();
        //Creamos un objeto HiloProgreso al cual
        //le pasamos por parámetro la barra de progreso
        hilo = new HiloProgreso(jProgressBar1);
        //Iniciamos el Hilo
        hilo.start();
        //Le damos tamaño y posición a nuestro Frame
        this.setLocation(200, 200);
        this.setSize(472, 249);
        //Liberamos recursos
        hilo = null;
        
       
       
        
        
    }
    
    public void iniciarSplash() {
        
        this.getjProgressBar1().setBorderPainted(true);
        this.getjProgressBar1().setForeground(new Color(50, 50, 153, 100));
        this.getjProgressBar1().setStringPainted(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jProgressBar1 = new javax.swing.JProgressBar();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setForeground(java.awt.Color.white);
        setMaximumSize(new java.awt.Dimension(800, 650));
        setMinimumSize(new java.awt.Dimension(800, 650));
        setPreferredSize(new java.awt.Dimension(800, 650));

        jPanel1.setLayout(new java.awt.BorderLayout());

        jProgressBar1.setForeground(new java.awt.Color(0, 255, 0));
        jPanel1.add(jProgressBar1, java.awt.BorderLayout.CENTER);

        getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

        jPanel2.setLayout(new java.awt.BorderLayout());

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/prototipopantallas/fondo.jpg"))); // NOI18N
        jPanel2.add(jLabel1, java.awt.BorderLayout.CENTER);

        getContentPane().add(jPanel2, java.awt.BorderLayout.PAGE_START);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//
//            public void run() {
//                
//                javax.swing.JFrame loading = new Loading();
//                loading.setLocationRelativeTo(null);
//                loading.setVisible(true);
//                loading.dispose();
//                
//                
//                
//            }
//        });
//    }
    
    public javax.swing.JProgressBar getjProgressBar1() {
        return jProgressBar1;
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JProgressBar jProgressBar1;
    // End of variables declaration//GEN-END:variables
}
